﻿using BusinessLayer.Dal;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace Biz
{
    public class ReceiptNote
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        public DateTime Time { get; set; }
        public Provider Provider { get; set; }
        public virtual List<ReceiptDetail> Products { get; set; }
        ReceiptDal dal = new ReceiptDal();

        public List<ReceiptNote> GetAll()
        {
            return dal.GetAll();
        }
        public List<ReceiptNote> GetAllByDate(DateTime from, DateTime to)
        {
            return dal.GetAllByDate(from, to);
        }
        public void Insert(List<ReceiptDetail> details)
        {
            dal.Insert(this, details);
        }
    }
}